<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <script type='text/javascript' src='http://localhost/hdphp/hdphp/Extend/Org/Jquery/jquery-1.8.2.min.js'></script>
<link href='http://localhost/hdphp/hdphp/Extend/Org/hdjs/hdui/css/hdui.css' rel='stylesheet' media='screen'>
<script src='http://localhost/hdphp/hdphp/Extend/Org/hdjs/hdui/js/hdui.js'></script>
<link href='http://localhost/hdphp/hdphp/Extend/Org/hdjs/hdvalidate/css/hdvalidate.css' rel='stylesheet' media='screen'>
<script src='http://localhost/hdphp/hdphp/Extend/Org/hdjs/hdvalidate/js/hdvalidate.js'></script>
<script src='http://localhost/hdphp/hdphp/Extend/Org/cal/lhgcalendar.min.js'></script>
<script src='http://localhost/hdphp/hdphp/Extend/Org/hdjs/hdslide/js/hdslide.js'></script>
<script type='text/javascript'>
HOST = 'http://localhost';
ROOT = 'http://localhost/hu_cms';
WEB = 'http://localhost/hu_cms/index.php';
URL = 'http://localhost/hu_cms/index.php?m=Admin&c=TplStyle&a=index';
APP = 'http://localhost/hu_cms/CMS';
COMMON = 'http://localhost/hu_cms/CMS/Common';
HDPHP = 'http://localhost/hdphp/hdphp';
HDPHPDATA = 'http://localhost/hdphp/hdphp/Data';
HDPHPEXTEND = 'http://localhost/hdphp/hdphp/Extend';
MODULE = 'http://localhost/hu_cms/index.php?m=Admin';
CONTROLLER = 'http://localhost/hu_cms/index.php?m=Admin&c=TplStyle';
ACTION = 'http://localhost/hu_cms/index.php?m=Admin&c=TplStyle&a=index';
STATIC = 'http://localhost/hu_cms/Static';
HDPHPTPL = 'http://localhost/hdphp/hdphp/Lib/Tpl';
VIEW = 'http://localhost/hu_cms/CMS/Admin/View';
PUBLIC = 'http://localhost/hu_cms/CMS/Admin/View/Public';
CONTROLLERVIEW = 'http://localhost/hu_cms/CMS/Admin/View/TplStyle';
HISTORY = 'http://localhost/hu_cms/index.php?m=Admin';
</script>
    </head>
    <body>
    	<div class='wrap'>
    		<div class='title-header'>模板列表</div>
    		<ul>
                <?php $hd["list"]["d"]["total"]=0;if(isset($dirs) && !empty($dirs)):$_id_d=0;$_index_d=0;$lastd=min(1000,count($dirs));
$hd["list"]["d"]["first"]=true;
$hd["list"]["d"]["last"]=false;
$_total_d=ceil($lastd/1);$hd["list"]["d"]["total"]=$_total_d;
$_data_d = array_slice($dirs,0,$lastd);
if(count($_data_d)==0):echo "";
else:
foreach($_data_d as $key=>$d):
if(($_id_d)%1==0):$_id_d++;else:$_id_d++;continue;endif;
$hd["list"]["d"]["index"]=++$_index_d;
if($_index_d>=$_total_d):$hd["list"]["d"]["last"]=true;endif;?>

    			<li <?php if($d['current']){?>class='current'<?php }?> dir='<?php echo $d['filename'];?>'>
    				<div><img src="<?php echo $d['image'];?>" alt="" ></div>
    				<p><?php echo $d['config']['author'][0];?></p>
    				<p><?php echo $d['config']['email'][0];?></p>
    			</li>
            <?php $hd["list"]["d"]["first"]=false;
endforeach;
endif;
else:
echo "";
endif;?>
    		</ul>
    	</div>
        <style>
            ul li{
                float:left;
                margin:10px;
                cursor: pointer;
                background: #ececec;
            }
            ul li.current{
                border:solid 1px #ccc;
            }
             ul li.current img{
                  opacity: 1;
            }
            ul li img{
                border:solid 1px #ccc;
                width:200px;
                height:200px;
                opacity: 0.4;
                margin-bottom: 5px;
            }
            ul li p{
                text-align: center;
                color:#333;
            }
        </style>
        <script>
            $('ul li').click(function(){
                var dirName=$(this).attr('dir');
                $.post(CONTROLLER+'&a=set',{dir:dirName},function(json){
                        alert(json.message);
                        location.reload(true);
                },'json');
            })
        </script>
    </body>
</html>